<?php
	include('../defines.php');

	FunctionsHelper::includeFiles(
		array(
			ADMINISTRATOR_CONTROLLER_DIRECTORY . 'users.php'
		)
	);

	$users = new Users();
	if (!$users->isLoggedUser())
		header('Location:' . ADMINISTRATOR_VIEW_PATH . 'login.php');

	$news = $users->getLoggedUser();
	
	FunctionsHelper::includeTop();
	
?>
<script type="text/javascript">
	$(function(){
		$("#buttonCountry").click(function(){
			document.location.href = "<?= ADMINISTRATOR_VIEW_PATH; ?>countries.php";
		});
		$("#buttonPlayers").click(function(){
			document.location.href = "<?= ADMINISTRATOR_VIEW_PATH; ?>players.php";
		});
		$("#buttonTournaments").click(function(){
			document.location.href = "<?= ADMINISTRATOR_VIEW_PATH; ?>tournaments.php";
		});
		$("#buttonNews").click(function(){
			document.location.href = "<?= ADMINISTRATOR_VIEW_PATH; ?>news.php";
		});
		$("#buttonUser").click(function(){
			document.location.href = "<?= ADMINISTRATOR_VIEW_PATH; ?>users.php";
		});
		$("#buttonSurvey").click(function(){
			document.location.href = "<?= ADMINISTRATOR_VIEW_PATH; ?>surveys.php";
		});
	});
</script>
<div class="withBorder" id="main">
	<div class="homeButtons firstLineButtons">
		<input type="button" id="buttonPlayers" class="homeButton" value="Jugadores" />
		<input type="button" id="buttonTournaments" class="homeButton" value="Torneos" />
		<input type="button" id="buttonNews" class="homeButton" value="Noticias" />
	</div>
	<div class="homeButtons">
		<input type="button" id="buttonCountry" class="homeButton" value="Paises" />
		<input type="button" id="buttonUser" class="homeButton" value="Usuarios" />
		<input type="button" id="buttonSurvey" class="homeButton" value="Encuestas" />
	</div>
</div>

<?php 
	FunctionsHelper::includeBottom();
?>